I'm trying to accomplish the task of linking to files within a collection from a post on a Jekyll site. However, I'm having an issue that relates to the collection having subdirectories, and those subdirectories having spaces in their names.
Here's a simplified example of how my site source is layed out:
├── 404.html
├── about.md
├── _config.yml
├── Gemfile
├── Gemfile.lock
├── index.md
├── _labs
│ └── Lab 01 Introduction
│ └── PS01 source.html
├── _posts
│ └── 2020-01-01-test_post.md
The post 2020-01-01-test_post.md contains the following markdown:
---
layout: post
title: "Introduction"
author: "Will Hopper"
---
[Link]({{ site.baseurl }}{% link _labs/Lab 01 Introduction/PS01 source.html %})
So far so good, and running jekyll serve succeeds just fine, meaning it can find the linked file at build time. The issue arises later, with the way jekyll has handled the spaces in the Lab 01 Introduction directory. Here is the contents of the _site folder after building:
└── _site
├── 404.html
├── about
│ └── index.html
├── assets
│ ├── main.css
│ └── minima-social-icons.svg
├── feed.xml
├── index.html
├── labs
│ └── Lab%2001%20Introduction
│ └── PS01 source.html
└── posts
└── test_post.html
As you can see, the spaces in the filename have been replaced with the URL encoded escapes, %20. As a result, the link in the post 404's.
I tried replacing the "raw" name of the folder with the URL encoded output, i.e., I tried {% link _labs/Lab%2001%20Introduction/PS01 source.html %} but now the site fails to build with Liquid Exception: Could not find document.
This HTML file is effectively a static file (i.e., it has no front matter). And curiously, Jekyll seems to leave spaces in the filenames alone!
Any ideas on what I could do to stop the spaces in my directory names from being URL encoded when the site is built?
Related
I am a beginner in Hugo. I generated a static site, added a theme, added some content. It works in my local. All the links behave as they are supposed to. Then I do "Hugo" to generate deployable files in public directoery. Now I placed this public folder in my server. The home page loads properly, but contents are redirecting to net domain site.
(copy site url and check in you your browser) => https://smehetre.xyz/
Config file below:
baseURL: https://smehtre.xyz/
languageCode: en-us
title: hello friend
theme: "PaperMod"
menu:
main:
- identifier: Search
name: Search
url: /search/
weight: 10
- identifier: Archives
name: Archives
url: /archives/
weight: 20
- identifier: Resume
name: Resume
url: /resume/
weight: 30
- identifier: About
name: About
url: /about/
weight: 40
Public folder deployed on my nginx server:
├── 404.html
├── about
│ └── index.html
├── archives
│ └── index.html
├── assets
│ ├── css
│ │ └── stylesheet.min.8e489ec970cd58539487a8f697c827fd0de4aa9f638217b7db51cbc230ff6f95.css
│ └── js
│ ├── highlight.min.2840b7fccd34145847db71a290569594bdbdb00047097f75d6495d162f5d7dff.js
│ └── search.min.994d971a9492abf73721874ff533ba36f8b86300a65b0f03c96111ab1f6f32b2.js
├── categories
│ ├── index.html
│ └── index.xml
├── index.html
├── index.json
├── index.xml
├── page
│ └── 1
│ └── index.html
├── posts
│ ├── index.html
│ ├── index.xml
│ ├── my-first-post
│ │ └── index.html
│ └── page
│ └── 1
│ └── index.html
├── search
│ └── index.html
├── sitemap.xml
└── tags
├── index.html
└── index.xml
Try to click on my first post, or Search or Archives or About page.
It redirects to https://net.domain.name/
Please HELP!!!
This looks like a DNS issue, not a Hugo issue.
According to the WhatsMyDNS Tool your Name Server isn't set at all anywhere (link).
According to ICANN, you've never actually registered your domain. Godaddy shows the same.
You need to actually purchase a domain before you can use it.
If you have purchased your domain, contact your registrar to figure out the issue.
If you haven't purchased it yet, make sure you do that.
I am trying to setup a template Jekyll project with the structure below. The goal is to reuse all markdown files in the project while being the least intrusive, keeping all custom layouts and configurations in a single folder.
.
├── README.md # some new project file stay in the roots
├── about.md # some new project file stay in the roots
├── docs # folder containing pages
│ └── assets
│ └── index.html # generated from README.md
│ └── about.html # generated from about.md
│ └── ...
├── jekyll # folder containing all jekyll specific files
│ └── _layout
│ └── assets
│ └── _config.yml
│ └── ...
To make this work, I'm running Jekyll from the /jekyll folder using the following configurations.
theme: jekyll-theme-cayman
source: ./..
destination: ./../docs
include:
- "./_layout"
- "./assets"
exclude:
- "./"
Here comes my problem: when I do this Jekyll ignores my custom layout. Could anyone help me understanding this problem?
P.S.: I'd prefer not to publish my custom layout as a new theme entirely.
I am trying to build a web application running wasm on the client side, and I am wondering what would be a good way of serving multiple pages.
My main concern is performance, because I would like to split the application up into contextual chunks instead of having one page with all of the content.
I am using Rust with the Yew framework for the client side, and so far I have only used yew_router to handle different routes on the client side, but they all work from the same HTML page and Wasm module. Now I would like to be able to serve different HTML pages with separate Wasm modules, and I am unsure how to realize this. Do I really have to write a dedicated crate for each page and compile those to individual Wasm modules, so I can serve them individually? Or is there some way I can compile one rust crate to multiple Wasm modules?
My current project structure looks like this:
.
├── Cargo.toml // workspace manifest
├── client
│ ├── Cargo.toml
│ ├── favicon.ico
│ ├── index.html
│ ├── main.js
│ ├── Makefile
│ ├── pkg // built using wasm-pack and rollup
│ │ ├── bundle.js
│ │ ├── client_bg.d.ts
│ │ ├── client_bg.wasm
│ │ ├── client.d.ts
│ │ ├── client.js
│ │ ├── package.json
│ │ └── snippets
│ ├── src
│ ├── statics
│ ├── styles
│ └── vendor
├── server
│ ├── Cargo.toml
│ └── src
└── ... other crates
and I run the server inside client/ where it responds with index.html to any incoming GET requests. The index.html links to the bundle.js in pkg/ which sets up the client_bg.wasm module.
Now I basically want to do this with another HTML page, with another Wasm module, preferably from the same Yew App in the client crate.
Thank you
Currently it's impossible to generate two wasm files from one crate. The solution is to use one create per wasm file and then let another build system to put output to correct places.
I have a Jekyll blog and some of the raw posts have some additional files at the same level with the markdown file. For example:
.
├── _posts
├── first-post
├── 2007-10-29-first-post.md
└── download.zip
How can I and up with a generated structure such as
.
├── _sites
├── first-post
├── index.html
└── download.zip
The download.zip file needs to be in the same location as its dependent post (I cannot use any includes or other redirect tricks)
Try this jekyll-postfiles which is:
A Jekyll plugin that copies static files from the _posts to the _site folder
I thought that setting the relative_directory (Jekyll Collection Docs) (github PR) property being set would help me keep my files organized without compromising my desired output, but it seems to be ignored/not used for producing files. I don't want my collections to be in the root directory, because I find it confusing to have ~10 collection folders adjacent to _assets, _data, _includes, _layouts, and others.
Fixes or alternative solutions are welcomed, as long as long as the output is the same, and my pages are in their own directory, without needing to put permalink front-matter on every single page.
_config.yaml
collections:
root:
relative_directory: '_pages/root'
output: true
permalink: /:path.html
root-worthy:
relative_directory: '_pages/root-worthy'
output: true
permalink: /:path.html
docs:
relative_directory: '_pages/docs'
output: true
permalink: /docs/:path.html
Directory Structure:
├── ...
├── _layouts
├── _pages
│ ├── root
│ │ ├── about.html
│ │ └── contact.html
│ ├── root_worthy
│ │ ├── quickstart.html
│ │ └── seo-worthy-page.html
│ └── docs
│ ├── errors.html
│ └── api.html
├── _posts
└── index.html
Desired output:
├── ...
├── _site
│ ├── about.html
│ ├── contact.html
│ ├── quickstart.html
│ ├── seo-worthy-page.html
│ └── docs
│ ├── errors.html
│ └── api.html
└── ...
It seems that the PR you mention is still not merged.
For 3.1.6 and next 3.2, jekyll code is still :
#relative_directory ||= "_#{label}"
But the requester made a plugin that looks like this :
_plugins/collection_relative_directory.rb
module Jekyll
class Collection
def relative_directory
#relative_directory ||= (metadata['relative_directory'] && site.in_source_dir(metadata['relative_directory']) || "_#{label}")
end
end
end