最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】给crifan的gitbook的books去批量make deploy部署

gitbook crifan 389浏览 0评论
之前弄完:
【已解决】把自己Mac中gitbook的template和books合并成一套
后,用之前的:
【已解决】批量编译和发布gitbook电子书 – 在路上
的Makefile:
/Users/crifan/dev/dev_root/gitbook/GitbookTemplate/gitbook_template/common/Makefile
继续去批量运行:
make deploy
更新后的book:
GitbookTemplate/gitbook_template/generated/books/5g_message_rcs_tech_summary/release/5g_message_rcs_tech_summary/website/index.html
就有对应的GA的:
<script src="gitbook/gitbook-plugin-google-adsense/plugin.js"></script>
发布后:
https://book.crifan.com/books/5g_message_rcs_tech_summary/website/
其中也有了GA的输出:
以及:
<script src="//
pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
" async="true" data-ad-client="ca-pub-6626240105039250" data-checked-head="true"></script>
html中有对应的adsbygoogle.js。确定无误。
此处继续给gitbook的books去批量:
make deploy
且不让Mac休眠:
希望能顺利全部编译成功
【后记】
好像是其他子页面中没有加上 adsbygoogle.js ?
后来发现是有的:
<script src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" async="true" data-ad-client="ca-pub-6626240105039250" data-checked-head="true"></script>
但是却是:
被放到了body中,而不是希望的head中
另外始终看到的是:
src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"
而不是希望的完整的https的地址,也不爽。
后来发现是:
代码中自己写的就是这样:
gitbook_template/generated/gitbook/node_modules/gitbook-plugin-google-adsense/book/plugin.js
        var adScript = document.createElement('script');
        adScript.src = '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
所以去改为:
        // adScript.src = '//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
        adScript.src = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
重新编译和发布。
希望有效果。
然后还是:
抽空先去看单个 gitbook_demo 的html的主页 和其他子页面 都有代码后,再去批量运行
确保了,每个html中的head中,都有:
<script src="../gitbook/gitbook-plugin-google-adsense/plugin.js"></script>
-》只能等真正页面加载后,才能研究是否真正生效。
是否插入了:
<script data-ad-client="ca-pub-6626240105039250" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
到了head中。
期间去:
【已解决】批量处理gitbook的脚本时忽略掉已处理的book
后来遇到了:
【已解决】calibre报错:calibre.ebooks.oeb.transforms.split.SplitError无法找到合适的折分点
然后就可以继续批量处理了。
然后运行完毕了:
去看看:
generated目录:
有55个
但是原目录books中有:
除掉:
convertToNewCommonTemplate.sh
还缺一个啊
去找找缺了哪个
更新
common/batchProcess/batch_process_ignore_books.txt
加上:
5g_message_rcs_tech_summary
gitbook_demo
program_common_logic
5g_tech_summary
good_automation_tool_makefile
python_common_code_snippet
all_age_sports_badminton
html_parse_tool_beautifulsoup
python_newbie_mistakes_questions
android_app_security_crack
http_restful_api
python_regex_re_intro
android_automation_uiautomator2
http_summary
python_spider_pyspider
api_tool_postman
ic_chip_industry_chain_summary
python_spider_scrapy
app_capture_package_tool_charles
improve_work_efficiency
rcs_tech_dev_summary
apple_develop_summary
industrial_automation_plc
regex_usage_examples
automobile_sales_summary
industrial_control_security_overview
resident_life_experience_summary
best_editor_vscode
information_security_overview
scientific_network_summary
china_suitable_living_suzhou
ios_automation_facebook_wda
selenium_summary
common_logic_hardware_embedded
learn_tech_method_experience
smart_speaker_disassemble_summary
computer_tech_summary
mobile_app_summary
super_search_regex
crack_assistant_xposed_framework
mobile_automation_overview
use_python_write_spider
crawl_your_data_spider_technology
mobile_network_evolution_history
work_job_summary
desktop_app_framework_electron
most_intelligent_python_ide_pycharm
xpath_summary
doc_format_markdown
multimedia_core_system_ims
youdao_note_summary
ebook_system_gitbook
popular_document_db_mongodb
editor_ide_summary
program_code_style
再去运行看看
TO_PROCESS_BOOKS=convertToNewCommonTemplate.sh make_life_better_python python_experience_csv_excel python_html_parse_pyquery
----------------------------------------
Current path=/Users/crifan/dev/dev_root/gitbook/GitbookTemplate/gitbook_template/common/batchProcess
LS_OUTPUT=convertToNewCommonTemplate.sh make_life_better_python python_experience_csv_excel python_html_parse_pyquery
BOOKS_SRC_ROOT=/Users/crifan/dev/dev_root/gitbook/GitbookTemplate/gitbook_template/books
但是竟然不去运行了
原来是:
make_life_better_python
是空目录:
那去给这3个更新代码过来:
发现这几个book还没发布呢。。。
那顺带把其他少的几个book也去clone过
[email protected]  ~/dev/dev_root/gitbook/GitbookTemplate/gitbook_template/books   master ●  git clone https://github.com/crifan/good_android_emulator_nox.git
Cloning into 'good_android_emulator_nox'...
remote: Enumerating objects: 146, done.
remote: Counting objects: 100% (146/146), done.
remote: Compressing objects: 100% (137/137), done.
remote: Total 146 (delta 2), reused 146 (delta 2), pack-reused 0
Receiving objects: 100% (146/146), 9.67 MiB | 2.12 MiB/s, done.
Resolving deltas: 100% (2/2), done.
 [email protected]  ~/dev/dev_root/gitbook/GitbookTemplate/gitbook_template/books   master ●  git clone https://github.com/crifan/web_transfer_proxy_tech.git
Cloning into 'web_transfer_proxy_tech'...
remote: Enumerating objects: 245, done.
remote: Counting objects: 100% (245/245), done.
remote: Compressing objects: 100% (178/178), done.
remote: Total 245 (delta 41), reused 230 (delta 26), pack-reused 0
Receiving objects: 100% (245/245), 6.10 MiB | 80.00 KiB/s, done.
Resolving deltas: 100% (41/41), done.
 [email protected]  ~/dev/dev_root/gitbook/GitbookTemplate/gitbook_template/books   master ●  git clone https://github.com/crifan/crawler_proxy_tool_mimproxy.git
Cloning into 'crawler_proxy_tool_mimproxy'...
remote: Enumerating objects: 107, done.
remote: Counting objects: 100% (107/107), done.
remote: Compressing objects: 100% (87/87), done.
remote: Total 107 (delta 16), reused 104 (delta 13), pack-reused 0
Receiving objects: 100% (107/107), 1.61 MiB | 590.00 KiB/s, done.
Resolving deltas: 100% (16/16), done.
 [email protected]  ~/dev/dev_root/gitbook/GitbookTemplate/gitbook_template/books   master ●  git clone https://github.com/crifan/popular_virtual_machine_vmware.git
Cloning into 'popular_virtual_machine_vmware'...
remote: Enumerating objects: 223, done.
remote: Counting objects: 100% (223/223), done.
remote: Compressing objects: 100% (192/192), done.
remote: Total 223 (delta 22), reused 222 (delta 21), pack-reused 0
Receiving objects: 100% (223/223), 9.76 MiB | 1.60 MiB/s, done.
Resolving deltas: 100% (22/22), done.
继续:

转载请注明:在路上 » 【记录】给crifan的gitbook的books去批量make deploy部署

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
87 queries in 0.107 seconds, using 20.51MB memory