github pages ignoring 2022 dates in liquid {{ page.date }}?? fine in local host - html

Using Jekyll to build a site, I have discrepancies between my local build and what GitHub pages renders.
I have a .html layout that uses the date property of the page for the title:
<h1>Meeting notes - {{ page.date | date_to_string }}</h1>
and the date is obtained thanks to the page's name YYYY-MM-DD-notes.html.
I then use a for loop to parse through all the meetings I have in site.meetings and display all meeting notes after one another in a meetings.html page.
My last two files are called: 2021-12-07-notes.html and 2022-01-18-notes.html so the first two titles in my meetings page should be:
Meeting notes - 18 Jan 2022
Meeting notes - 07 Dec 2021
Which is indeed what I get in my local build (along with all the previous ones, first meeting being in 2019).
But what GitHub pages renders is:
Meeting notes -
Meeting notes - 07 Dec 2021
As if he couldn't 'see' the 2022 date. Still working fine with all previous dates btw and again, on the local build.
Could someone explain this weird behavior?

Ok this was simply because I didn't have the right file name.
The file was actually called 2022-01-18_notes.md and not 2022-01-18-notes.md which made GitHub pages not recognise the date. Apparently my local jekyll is a bit more tolerant.

Related

Localize Jekyll 4.3.2 date

I am trying to localize a date in Jekyll. All information I find seems to be related to plugins that are no longer maintained, don't work, or to something that seems to have existed in Jekyll built-in earlier.
I have post with matter containing a list of dates:
---
events:
- 2023-07-15
---
To display this in a friendly manner, I use:
{% assign friendly_date = e | date: "%A %e %B %Y" %}
This displays the weekday & month in English, but our website is in Dutch.
So how can we force this to be in Dutch?
Can you tell Jekyll to localize by default in Dutch?
Can you force it in the CI/CD pipeline perhaps, that would also work (using GitLab)?
I did find some plugins for multilingual websites, but that all seems overcomplicated since our website is in one single language.

What is wrong with my file name?

I copied this web page from here to a Windows machine then I renamed it from SQLSaturday #588 - New York City 2017 Sessions Schedule.htm to SQLSaturday #588 - New York City 2017 Sessions.html. I edited the page to remove some stuff like the download buttons and it loaded fine on my machine.
I then uploaded it to my GitHub account. Now it is broke and I do not know why. It 404s on this:
marvelous-software.github.io/SQLSaturday/SQLSaturday%20#588 - New York City 2017 Sessions.html
I do not know why it puts a %20 for one single space occurrence and not the rest. Doesn't matter though since if I replace the %20 with a space or all the spaces with %20 it fails just the same. If I rename the file to x.html it works.
Anyone know why I can not use the file name and what I can do to fix it?
This is my page. You need to click Events then SQL Saturday so there will be two links, SQL Saturday 588, NYC, May 20, 2017. One works and the other is broke.
I think the biggest problem is the # sign. When I encode it with %23, it works for me.
The really correct encoding is
SQLSaturday%20%23588%20-%20New%20York%20City%202017%20%20Sessions.html
but for Firefox, only the %23 seems to matter.

How to know when GitHub Pages finished generating Jekyll?

I have a complex Jekyll website. Every change can take a few minutes to generate.
On my local machine I can see the progress that tells me when the re-generation finished.
However on GitHub Pages (Enterprise) how do I know if what I am looking at is the latest version or if it is still generating?
I was thinking maybe Jekyll could print a timestamp somewhere when generating?
You can use <p>Page version : {{ site.time | date: '%B %d, %Y - %H:%M:%S %Z'}}</p> in you footer to print datetime on each page.
Don't forget to set your timezone variable in configuration.

Jekyll: blog post ignored - how to debug?

I am trying to set up a blog on github.io using jekyll (site, source)
My problem is that my article in the _posts folder semms to be ignored. I would like to debug the site generation.
I have seen this advice to debug jekyll, but so far I did not understood what is missing.
Can I see if jekyll consider my file or if it is ignored?
In your files names replace underscore by hyphen.
wrong : 2014-11-01_part_of_it.md
good : 2014-11-01-part-of-it.md
the article/post needs a publish date in the front matter
---
date: 2014-11-01 08:57:00 GMT
---
Also keep in mind that your post won't be generated if the publishing date (including the daylight saving time, in my case) is in the future.
date: 2018-07-18 18:00:00 +0100
Reading: _posts/2018-07-18-no-more-ssh-login.markdown
Skipping: _posts/2018-07-18-no-more-ssh-login.markdown has a future date
Had to run bundle exec jekyll serve --verbose to realize it.

Yahoo! Finance CSV file will not return Dow Jones (^DJI)

I am trying to retrieve market data from Yahoo! finance and the script has worked fine for years, but recently, it stopped showing The Dow Jones data. Here is the URL:
http://download.finance.yahoo.com/d/quotes.csv?s=^DJI,^IXIC,^GSPC,^TNX&f=snl1d1t1c1ohg
The URL should return data on:
Dow Jones
NASDAQ
S&P
10 Year Bonds
It actually doesn't get returned into the CSV for me, I have tried everything I can think of, but to no avail, and I haven't seen anyone having the same problem online.
Any ideas and is anyone having the same issues?
Thanks.
Replace ^DJI with INDU (that's one of the tickers for the Dow) - that will work.
No idea why ^DJI stopped working last weekend - someone has made a 'negative enhancement'.
Cheerio
GT
According to Yahoo at:
http://developer.yahoo.net/forum/index.php?showtopic=6943
Thank you for writing to Yahoo! Finance.
I understand you're reporting that you cannot download CSV data for ^DJI. I can certainly give you more information about this.
The limitation you are encountering is due to restrictions by the Dow Jones Index. Yahoo! is no longer able to provide Dow Jones Index data in this manner. I apologize for any inconvenience caused.
Please let me know if I can be of further assistance.
Thank you again for contacting Yahoo! Finance.
Regards,
Brett
Yahoo! Finance Customer Care
The other post that suggests using INDU does seem to work!... Wonder if Yahoo (or Dow Jones) just missed this one and it will eventually go away...
I know this question has been answered some time ago but I've recently run into this ^DJI and Yahoo! quotes issue again due to another change at Yahoo! and have come up with a solution that might help the OP and anyone else who reaches this page as a result of a search.
As a bit of background please note that there's several URL's that may conceivably be used to download historical quote data from Yahoo. They are:
1) http://download.finance.yahoo.com/d/quotes.csv
2) http://ichart.finance.yahoo.com/table.csv
3) http://finance.yahoo.com/q/hp
1) is the one the OP listed, 2) is effectively the "download" link that you get below the web page display of quotes and 3) is the normal historical price quote webpage URL.
It turns out that while 1) has been blocked for ^DJI and some others since Aug 2011 as metioned by Mario Fernandez, 2) was actually still working until just the other day. I know this because I've been using it and it stopped working (as it turned out) about a week ago. As an aside, 2) had the benefit that it would in fact allow you to retrieve more data than was apparently available via either 1) or 3), for example, you could retrieve data all the way back to 1928 using method 2), but I digress. Anyway, as I say, 2) also stopped working recently which left me with the frustration of not being able to keep my datasets/models updated automatically.
Given that I actually use the ^DJI data for some of my models etc, I eventually spent an hour or 2 today writing a page scraper for the normal quotes page (e.g. no. 3) which will now directly fetch quotes from the HTML quotes web page. This is in the context of an open source command line downloader application written in Python that I've done some minor work on over the last couple of months. It is what I currently use to refresh my datasets on a routine basis. With the latest patch, the OP and anyone else that want to download ^DJI has another possible solution to download ^DJI as required.
If you'd like to try this out then you'll need to download and install Python first (on Windows. Linux and Mac has Python built in.) I suggest ActiveState's Python distribution, available here:
http://www.activestate.com/activepython/downloads
Note they ask for registration details but it's not obligatory. You can just ignore the registration page you get after clicking on one of the download links.
Then you need the pyQ program source. You can get this from the project page here:
http://bazaar.launchpad.net/~wprins/python-pyq/trunk/view/head:/pyq.py
Edit 2016-10-20: Code is now available on github and will run under Python 3 as well: https://github.com/ByteJuggler/pyq
Click the "download" link, and save the script somewhere suitable. Then open up a command prompt, "cd" to the folder you've downloaded the script to, and try to run the script with "pyq". Assuming Python has been installed, you should be presented with a summary of usage. In it's simplest form, a command like:
pyq IBM
will fetch a live quote line for IBM.
Something like:
pyq 20120601 20120701 IBM
... will fetch quotes for IBM from 20120601 to 20120701 date. Etc. Output is effectively CSV. If you want to save the output to a file, then redirect the output as per normal:
pyq 20120601 20120701 IBM >ibm.csv
Anyway, hope that helps someone. (I stumbled over this page earlier today while trying to figure out why my ^DJI dataset was out of date since about a week ago and decided to post back here if/when I came up with a solution.)
Edit: Please note for ^DJI you should quote the ticker, for example:
pyq 20120601 20120701 "^DJI" >"^DJI.csv"
I think that you are better off contacting Yahoo! Finance. As they know their system and will most likely be able to help.
now that yahoo blocked INDU you can use an ETF that tracks the index instead. I don't think they would block that.
I'm using Google Finance to get the data since Y! Finance has stopped working. Albeit Google might change their policy as well in the future. Until this will happen I access
http://finance.google.com/finance/info?lient=ig&q=INDEXDJX:.DJI&callback=?
which will return a JSONP document.
I saw this last week...
http://webdesignsnow.com/forums/about125.html which describes a change as well as the message seen in the csv file.
The following link: http://finance.yahoo.com/q/hp?s=^DJI will give you some of the information that you are interested in (like Open, DaysHigh, and DaysLow).
Furthermore, the following non-functioning code:
wget -qO ^DJI.csv "http://ichart.finance.yahoo.com/table.csv?s=^DJI"
can be replaced with the following hack:
(echo "Date,Open,High,Low,Close,Volume,Adj Close"
for y in {0..7603..66}; do # increase 7603 if necessary
wget -qO- "http://finance.yahoo.com/q/hp?s=^DJI&y=$y" |
sed 's/<\/\(td\|a\)>/\n/g' |
grep yfnc_tabledata1 |
sed -e 's/<.*>//g' -e 's/\([0-9]\),\([0-9]\)/\1\2/g' |
grep -v ^$ |
awk 'BEGIN {m["Jan"]=1; m["Feb"]=2; m["Mar"]=3;
m["Apr"]=4; m["May"]=5; m["Jun"]=6;
m["Jul"]=7; m["Aug"]=8; m["Sep"]=9;
m["Oct"]=10; m["Nov"]=11; m["Dec"]=12}
NR%7==1 {printf "%d-%02d-%02d,",$3,m[$1],$2}
NR%7>1 {printf "%s,",$0} NR%7==0'
done) > ^DJI.csv
which will generate a table with daily historical data for the ^DJI starting from January 29, 1985.