How do I deploy octopress 3 to a subdirectory within an existing gh-pages site? - ruby

I am using Octopress 3, and when I run jekyll build, it generates the correct set of files (which includes my static files, see list of files below):
$ cd _site
:_site$ ls -a
. CNAME assets google2d8.html index-alternative.html
.. about blog increase-revenue.html index.html
Note that my entire jekyll-generated blog is now safely stored within \blog\, which is how I want it.
But once I do octopress deploy, it overwrites this entire folder (which also overwrites my existing static files), see listing below:
$ cd _site
:_site$ ls -a
. .. Gemfile Gemfile.lock about css feed.xml index.html jekyll
Here is my _config.yml:
title: My Title
email: some#email.com
description: > # this means to ignore newlines until "baseurl:"
some description
baseurl: "/blog" # the subpath of your site, e.g. /blog
url: "http://example.com" # the base hostname & protocol for your site
twitter_username: myusername
source: '../'
# Build settings
markdown: kramdown
theme: minima
This is my _deploy.yml
method: git # How do you want to deploy? git, rsync or s3.
site_dir: _site # Location of your static site files.
git_url: my_git_url
git_branch: gh-pages-2 # Git branch where static site files are commited
Note: Once I remove the following line from my _config.yml: source: '../', my jekyll build generates that deploy folder like octopress deploy does.
Given the new Octopress 3 and an existing static site hosted on my gh-pages branch, how do I deploy my blog to a subdirectory of that existing gh-pages site?

You're not setting the root dir correctly.
Follow this instruction:
http://octopress.org/docs/deploying/subdir/

Related

module files not downloading for themes

I want to change my site using Hugo. I get stuck with modules. As per documentation (e.g. this theme) I just add theme = "github.com/nodejh/hugo-theme-mini" to the config file. It fails like this:
WARN ... found no layout file for "HTML" for kind "term": You should ...
if I perform hugo mod vendor the directory structure of the theme seems created in the _vendor dir, but there is not a single file inside. which explains the "not found" error in my eyes.
nothing (!) is rendered.
I also have this effect with a couple of other themes (I thinknoteworthy being one of them).
Set up a clean project
hugo new site testModules
cd testModules
and enable Hugo modules
hugo mod init randomName`
Paste the following lines in config.toml:
baseURL = "http://example.org/"
title = "Hugo Modules Test"
[module]
[[module.imports]]
path = "github.com/nodejh/hugo-theme-mini"
Start Hugo
hugo serve -D
Done!
The content of github.com/nodejh/hugo-theme-mini" will be downloaded and used as theme.
See the theme's documentation to add content
Optional:
hugo mod vendor
will make the content of the remote repo available in the _vendor folder.
(Surprisingly the content of exampleSite was not downloaded during the quick test I made)

Github-pages showing only front-matter

I'm unable to see the index.html get rendered with jekyll's front matter. In fact, the front matter is all I see on the webpage.
Here is the folder layout:
and the _config.yml:
title: badabing badaboom
email: xyz#gmail.com
description: tbd
#baseurl: "" # the subpath of your site, e.g. /blog
url: "" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username:
github_username:
encoding: utf-8
# Build settings
theme: jekyll-theme-clean-blog
plugins:
- jekyll-feed
remote_theme: StartBootstrap/startbootstrap-clean-blog-jekyll
# Exclude from processing.
# The following items will not be processed, by default.
# Any item listed under the `exclude:` key here will be automatically added to
# the internal "default list".
#
# Excluded items can be processed by explicitly listing the directories or
# their entries' file path in the `include:` list.
Any ideas on how I could fix this, or what I should look into?
My god... *facepalm
I just needed to get rid of .nojekyll
GitHub Pages will use Jekyll to build your site by default. If you
want to use a static site generator other than Jekyll, disable the
Jekyll build process by creating an empty file called .nojekyll in the
root of your publishing source, then follow your static site
generator's instructions to build your site locally.

How to compile sass sourcemap in jekyll

I am using jekyll 3.4.0,
i am using sass for styling my website.
while compiling, it is won't create style.css.map file in _site folder, which very helpful for debugging.
My config.yml file
markdown: kramdown
port: 8080
sass:
sass_dir: css
sourcemap: true
style: compact
I don't think Jekyll (yet) supports SASS source maps.
For my projects I have added a SASS build step to my deploy script, which generates source map:
#!/bin/bash
# destination folder in which the build result will be stored
DEST="./_site/style"
# folder in which original SCSS files will be places
ORIGINALS=$DEST/originals
# folder in which include SCSS file will be places
INCLUDES=$ORIGINALS/_sass
# remove the previous version of the folder
rm $ORIGINALS -r
mkdir $ORIGINALS
# copy original SASS include files to output folder
cp ./_sass/ $ORIGINALS -r
# name of the entry point SCSS file (without the extension)
SASS_FILE=style
# copying the entry point SCSS file to the output folder
# (removing the frontmatter from the file)
tail -n +3 ./style/$SASS_FILE.scss > $ORIGINALS/$SASS_FILE.scss
# building the entry SCSS file
sass --load-path $INCLUDES --sourcemap=auto $ORIGINALS/$SASS_FILE.scss $DEST/$SASS_FILE.css
Important
Don't forget to configure your web server to server SCSS mime types.
Additional notes
The important thing here is that original SCSS files also get deployed to the web server, so that a browser can access them!
Also sourcemap parameter needs to be set to auto so that correct relative paths to original SCSS files get inserted into sourcemap.

Blog posts are not showing in Jekyll?

I have created a blog using Jekyll now theme. And I've created repo in github to publish the blog. But the posts are not showing in github pages.
repo: https://github.com/mubumbz/blog
blog: http://mubumbz.github.io/blog/
In my case the blog post time was a future date (due to timezone mismatch) hence it was not published though _posts folder had my markdown file
executing 'jekyll build' will give the same message
sachinms#MS:/my-new-blog/my-personal-blog$ jekyll build
Configuration file: /my-new-blog/my-personal-blog/_config.yml
Theme Config file: /home/sachinms/gems/gems/jekyll-theme-chirpy-4.0.1/_config.yml
Source: /my-new-blog/my-personal-blog
Destination: /my-new-blog/my-personal-blog/_site
Incremental build: disabled. Enable with --incremental
Generating...
Skipping: _posts/2021-07-17-Minimal-API-ASPNET-6.md has a future date
done in 0.38 seconds.
Auto-regeneration: disabled. Use --watch to enable.
you must post added _post directory and post name must be year-mouth-day-post_name.md format
after on the blog main directory run command bundle exec jekyll build or jekyll build and push remote repo.

Move octopress blog to subfolder

I have currently my octopress blog up and running on my digital ocean droplet and everything works fine. But it is in the root folder of the droplet and I want to move it to a blog folder. Is that just moving all content to that subfolder, or is there more work to do to get this done to be aware of?
According to the Octopress documentation, if you are deploying in a subdirectory you'll need to update the following files:
_config.yml
config.rb
Rakefile
If you're deploying to a subdirectory on your site, or if you're using
Github's project pages, make sure you set up your urls correctly in
your configs. You can do this almost automatically:
rake set_root_dir[your/path]
# To go back to publishing to the document root
rake set_root_dir[/] Then update your _config.yml and Rakefile as follows:
# _config.yml
url: http://yoursite.com/your/path
# Rakefile (if deploying with rsync)
document_root = "~/yoursite.com/your/path"
To manually configure deployment to a subdirectory, you'll change _config.yml, > config.rb and Rakefile. Here's an example for deploying a site to the /awesome
subdirectory:
# _config.yml
destination: public/awesome
url: http://example.com/awesome
subscribe_rss: /awesome/atom.xml
root: /awesome
# config.rb - for Compass & Sass
http_path = "/awesome"
http_images_path = "/awesome/images"
http_fonts_path = "/awesome/fonts"
css_dir = "public/awesome/stylesheets"
# Rakefile
public_dir = "public/awesome"
# If deploying with rsync, update your Rakefile path
document_root = "~/yoursite.com/awesome"
source: http://octopress.org/docs/deploying/subdir/

Resources