we configured hexo by using the alternate configuration file which required copying "node_modules/hexo-theme-next/_config.yml" to "_config.next.yml"
when we update “next” theme, you have to recopy that file (so you are working with the newest version of the config) but it wont have all of the config changes you made to it. You have to go in and remake all the changes (first, search for “_config.next.yml” to find all the places you modified the config, then make a backup copy of the working _config.next.yml, then copy the new one (see app note 4) and lastly reapply all the config changes)
Note this plugin adds reading time info at the top of the article Example Creating a blog using hexo Posted on 2020-11-28 Symbols count in article: 2k Reading time ≈ 2 mins.
THIS FEATURE HAS BEEN DISABLED (FIREBASE RULES HAVE BEEN MODIFIED TO REQUIRE AUTHENTICATION) BECAUSE THESE INSTRUCTIONS LEAVE THE FIREBASE DATABASE INSECURE. DISABLED TILL I FIGURE OUT A FIX
Edit theme config file and add or change firestore section:
#NOTE** you need web api key, project_id, and to create a firestore database called blog_hits(for the collection) as described in web article above
#NOTE** this works. once setup, you’ll see hit counts for every post. You can see it at the top of the post and/or in the firebase database
edit _config.next.yml
1 2 3 4 5
firestore: enable:true collection:blog_hits#required, a string collection name to access firestore database apiKey:# secret projectId:blog-page-counters
I did not like their privacy policy nor that users need a disqus account to comment
- follow instructions here: https://theme-next.js.org/docs/third-party-services/comments.html?highlight=disqus
- created a disqus account
- modify _config.next.yml
- maybe check out gittalk See https://lanvoyager.github.io/posts/66a6d538/#more
# generate sitemap hexo generate # Then, there should be sitemap.xml in public folder under root directory. ls /home/fcarella/CodeProjects/static_web_sites/hexo/uu3.gitlab.io/public/sitemap.xml
Enable sitemap in _config.next.yml
1 2 3 4 5 6 7 8 9
menu: home:/||fafa-home #about: /about/ || fa fa-user tags:/tags/||fafa-tags categories:/categories/||fafa-th archives:/archives/||fafa-archive #schedule: /schedule/ || fa fa-calendar sitemap:/sitemap.xml||fafa-sitemap #commonweal: /404/ || fa fa-heartbeat
Then deploy by pushing to gitlab
1 2 3 4 5 6
#.... push to gitlab repo... git add . git commit -m "add sitemap and make page google searchable" git push origin master #... # then test that its visible
Anyway, I just followed the new instructions at google. Basically, it ask you to download an html file (filename_google_gave_you.html) and verify it (click verify button on their web page instructions). So I did, I downloaded into the source folder. Next you have to tell hexo NOT to render the html file google sent you because google expects to see just the contents of the original file, not all the rendered stuff hexo does to it. So disable rendering for that file:
edit _config.xml
1 2
skip_render: -"filename_google_gave_you.html"
Then you do this next… (NOTE **very important to hexo clean or it won’t verify)
1 2 3 4 5
hexo clean hexo generate git add . git commit -m "add sitemap and make page google searchable" git push origin master
Then I committed and pushed to gitlab and verified as the search console asked me to
The objective is to deploy the static website created in Application Note 1 to gitlab.
Provide a summary of instructions and procedures in the form of bash scripts
Procedures
Step 1 : Create .gitlab-ci.yml in the root of the hexo static web site
the .gitlab-ci.yml file is a script that tells the gitlab CI/CD system how to build and deploy the website on the server.
the script creates a linux/nodejs based docker image, installs hexo into it and then copies the web site files over to it. The web site is hosted on that docker image
check the pipeline for errors (note the URL of the gitlab page can be found on the gitlab repo page under Settings/Pages)
NOTE** make sure the web page is visible to everyone: goto “Settings/General”/“Visibility, project features, permissions” on the gitlab project web page, and set “Pages” visibility to “Everyone”.
# # Requirements # Installing Hexo requires: # Node.js (Should be at least Node.js 10.13, recommends 12.0 or higher) # Git # on arch assume AUR nvm is installed and Node.js >=10.13 is installed (confirm with nvm ls) node --version v12.9.0 # we good to go! # check git # git --version # git version 2.29.2 we good to go!
Create the repo on gitlab in the usual way, but observe the following…
NOTE **
the way we name the project is important. If we dont name it right we’ll have problems with SSL/TLS as described below or we’ll have problems with indexing our webiste on google.
Symbols count in article: 1.2kReading time ≈1 mins.
Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
NOTE** there are other ways to do this (see documentation above), but, this is my way ;)
assume the following directory structure and file locations
the location of this markdown file (the one you’re reading right now)
the location of the images rendered in this page
follow these steps to include an image in your markup
put your images in source/images/<markdown-filename> where "<markdown-filename>" is the same name as the post where the image will appear
in this example, the post is in the file source/_posts/artifacts/000_hexo-quickstart.md so we create the folder source/images/000_hexo-quickstart and copy images to that folder (here we copied f14.jpeg and ftdi.png), etc…
to use an image include this markdown in the page (note /blog is the root: blog setting in _config.yml) ![](/images/000_hexo-quickstart/ftdi.png)
and another… ![](/images/000_hexo-quickstart/f14.jpeg)