CNAME file

13 views
Skip to first unread message

nickt...@gmail.com

unread,
Mar 18, 2018, 2:55:34 PM3/18/18
to nikola-discuss
As per the handbook, I added a CNAME file in the files/ directory in the src branch, but this is not copied to the root directory of the master branch (as is required by Github pages) when running github_deploy. I also cannot find anything referring to "CNAME" in the nikola source. I'm wondering if CNAME files are still being handled in Nikola. I currently use Nikola 7.8.11.

Chris Warrick

unread,
Mar 18, 2018, 2:58:12 PM3/18/18
to Nikola—Discuss
Those files are not handled in any special way. If you put a file in
the `files` directory, it will be copied as-is to the output. Are you
sure that:

1) you ran `nikola build` after adding that file?
2) FILES_FOLDERS was not changed in your conf.py?

--
Chris Warrick <https://chriswarrick.com/>
PGP: 5EAAEA16
Message has been deleted
Message has been deleted

Roberto Alsina

unread,
Mar 20, 2018, 7:59:02 AM3/20/18
to nikola-...@googlegroups.com
I cant give you the details because I am on a train but check the manual. You need to change where the files are copied to.

El mar., 20 de mar. de 2018 8:57 AM, <nickt...@gmail.com> escribió:
The file is correctly copied the files/ folder of the output directory. Github pages requires the CNAME file to be in the root directory instead, so I was expecting Nikola would handle the file in a special way. I'm wondering if there is a workaround. Pushing the file to master does not work as running github_deploy will remove the pushed file.
--
You received this message because you are subscribed to the Google Groups "nikola-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nikola-discus...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Roberto Alsina

unread,
Mar 20, 2018, 11:17:22 AM3/20/18
to nikola-...@googlegroups.com
Ok, here is the thing. By default, doing what you did should work. I can confirm it works because I just tried it (see long block of text at the end of mail).

However, it does look like you edited your FILES setting. The default is

FILES = {'files': ''}

That means "take the content of the files folder and copy it to the output". Seems you have changed it to 

FILES = {'files': 'files'}

That means "take the content of the files folder and copy it to the output in the files subfolder"

So, put it back as it was and all good.

Here is how it works by default:

 nikola  ~/P/nikola   master ±  nikola init -q foo2
[2018-03-20T15:14:15Z] INFO: init: Created empty site at foo2.
 nikola  ~/P/nikola   master ±  cd foo2
 nikola  ~/P/n/foo2   master ±  touch files/CNAME
 nikola  ~/P/n/foo2   master ±  nikola build
Scanning posts........done!
.  copy_files:output/CNAME
.  copy_assets:output/assets/css/bootstrap.min.css.map
.  copy_assets:output/assets/css/docs.css
.  copy_assets:output/assets/css/bootstrap-theme.min.css.map
.  copy_assets:output/assets/css/bootstrap-theme.min.css
.  copy_assets:output/assets/css/bootstrap.min.css
.  copy_assets:output/assets/css/theme.css
.  copy_assets:output/assets/css/images/ie6/borderTopLeft.png
.  copy_assets:output/assets/css/images/ie6/borderTopCenter.png
.  copy_assets:output/assets/css/images/ie6/borderMiddleRight.png
.  copy_assets:output/assets/css/images/ie6/borderBottomRight.png
.  copy_assets:output/assets/css/images/ie6/borderBottomLeft.png
.  copy_assets:output/assets/css/images/ie6/borderBottomCenter.png
.  copy_assets:output/assets/css/images/ie6/borderTopRight.png
.  copy_assets:output/assets/css/images/ie6/borderMiddleLeft.png
.  copy_assets:output/assets/js/jquery.min.map
.  copy_assets:output/assets/js/jquery.min.js
.  copy_assets:output/assets/js/flowr.plugin.js
.  copy_assets:output/assets/js/bootstrap.min.js
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.woff
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.woff2
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.svg
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.ttf
.  copy_assets:output/assets/fonts/glyphicons-halflings-regular.eot
.  copy_assets:output/assets/css/rst_base.css
.  copy_assets:output/assets/css/baguetteBox.min.css
.  copy_assets:output/assets/css/ipython.min.css
.  copy_assets:output/assets/css/nikola_ipython.css
.  copy_assets:output/assets/css/nikola_rst.css
.  copy_assets:output/assets/css/rst.css
.  copy_assets:output/assets/css/html4css1.css
.  copy_assets:output/assets/xml/atom.xsl
.  copy_assets:output/assets/xml/rss.xsl
.  copy_assets:output/assets/js/flowr.js
.  copy_assets:output/assets/js/baguetteBox.min.js
.  copy_assets:output/assets/js/fancydates.js
.  copy_assets:output/assets/js/html5.js
.  copy_assets:output/assets/js/moment-with-locales.min.js
.  copy_assets:output/assets/js/html5shiv-printshiv.min.js
.  copy_assets:output/assets/css/code.css
.  render_posts:timeline_changes
.  render_galleries:output/galleries
.  render_galleries:output/galleries/index.html
.  render_galleries:output/galleries/rss.xml
.  render_listings:output/listings/index.html
.  render_taxonomies:output/archive.html
.  render_taxonomies:output/index.html
.  render_taxonomies:output/categories/index.html
.  render_taxonomies:output/rss.xml
.  create_bundles:output/assets/css/all-nocdn.css
.  create_bundles:output/assets/js/all.js
.  create_bundles:output/assets/css/all.css
.  create_bundles:output/assets/js/all-nocdn.js
.  sitemap:output/sitemap.xml
.  sitemap:output/sitemapindex.xml
.  robots_file:output/robots.txt
 nikola  ~/P/n/foo2   master ±  ls -l output/
total 40
-rw-r--r-- 1 ralsina domain^users 3085 mar 20 12:14 archive.html
drwxr-xr-x 6 ralsina domain^users 4096 mar 20 12:14 assets/
drwxr-xr-x 2 ralsina domain^users 4096 mar 20 12:14 categories/
-rw-r--r-- 1 ralsina domain^users    0 mar 20 12:14 CNAME
drwxr-xr-x 2 ralsina domain^users 4096 mar 20 12:14 galleries/
-rw-r--r-- 1 ralsina domain^users 3263 mar 20 12:14 index.html
drwxr-xr-x 2 ralsina domain^users 4096 mar 20 12:14 listings/
-rw-r--r-- 1 ralsina domain^users   79 mar 20 12:14 robots.txt
-rw-r--r-- 1 ralsina domain^users  726 mar 20 12:14 rss.xml
-rw-r--r-- 1 ralsina domain^users  711 mar 20 12:14 sitemapindex.xml
-rw-r--r-- 1 ralsina domain^users  864 mar 20 12:14 sitemap.xml

Reply all
Reply to author
Forward
0 new messages