Skip to content

Commit d3d2e14

Browse files
authored
Merge pull request #40 from eecs485staff/hotfix/print-preview-chrome
[Hotfix] Un-garble print previews in Chrome
2 parents 915d64b + 7fd5e97 commit d3d2e14

File tree

14 files changed

+84
-15
lines changed

14 files changed

+84
-15
lines changed

.githooks/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ PROJECT_ROOT=`dirname $GITHOOKS_DIR`
1010

1111
set -x
1212

13-
npx webpack --env prod
13+
npx webpack --env.production
1414
git add $PROJECT_ROOT/assets/js/primer_spec_plugin.min.js

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ assets/**/*.html
88
assets/**/*.md
99

1010
.DS_Store
11+
.jekyll-cache

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.0
1+
1.1.1

_layouts/spec.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
<!-- BEGIN CUSTOM SPEC CODE -->
99
{% if jekyll.environment == "dev" %}
1010
{% assign base_url = "http://localhost:4000" %}
11+
{% elsif jekyll.environment == "site-preview" %}
12+
{% assign url_size = site.url | size | minus: 1 %}
13+
{% assign base_url = site.url | slice: 0, url_size %}
1114
{% else %}
1215
{% assign base_url = "https://eecs485staff.github.io/primer-spec" %}
1316
{% endif %}

assets/js/primer_spec_plugin.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ Due: ~~8pm, Apr 1, 2019~~ **Anytime!** _This is an individual project._
1111
# Introduction
1212
In Computer Science courses, project specifications tend to get [really](https://web.archive.org/web/20180425010014/https://eecs485staff.github.io/p3-insta485-clientside/) [long](https://web.archive.org/web/20190424183409/https://eecs280staff.github.io/p3-euchre/). The intention for such a long document is good — they usually provide all the information that a student would need to successfully complete the project. However, this can also make it difficult for students to find information quickly — they often get lost in the document, and cannot easily find the information they need on the fly.
1313

14-
<!-- <img src="https://gdurl.com/npWU" alt="Infinite scroll..." height="250"/> -->
15-
1614
| <img src="https://media.giphy.com/media/vvWhQsVAFkyisScAsM/200w_d.gif" alt="Infinite scroll..." height="150"/> |
1715
|:--:|
1816
| _Infinite scroll..._ |
@@ -74,7 +72,7 @@ $ python3 -m http.server
7472

7573
Visit [http://localhost:8000](http://localhost:8000) on your web browser. The page should look similar to this screenshot:
7674

77-
<img src="https://gdurl.com/1Kq10" height="250" alt="project page without sidebar" />
75+
<img src="https://drive.google.com/uc?export=view&id=1Kplxw_Eb7343xLFGXTcpjNpsay9GraMe" height="250" alt="project page without sidebar" />
7876

7977
The spec already looks pretty good, but it could certainly be improved with a sidebar.
8078

@@ -83,7 +81,7 @@ In this section, you will add a sidebar to the HTML page and hard-code its conte
8381

8482
When you're done with this section, your webpage will have a sidebar on the left, something like this screenshot:
8583

86-
<img src="https://gdurl.com/zJi1" height="250" alt="project page with sidebar" />
84+
<img src="https://drive.google.com/uc?export=view&id=1_QPsSGlXKjfqY-3TUbsXej5isOZypK7U" height="250" alt="project page with sidebar" />
8785

8886
Of course, _your_ finished webpage doesn't have to look like this. After all, this project isn't autograded! (In fact, feel free to showcase your project spec design with us! Create an issue on [our GitHub repository](https://github.com/eecs485staff/primer-spec/issues) with a screenshot of your design.)
8987

jekyll-theme-primer-spec.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
1515
s.platform = Gem::Platform::RUBY
1616
s.license = 'MIT'
1717

18-
s.add_dependency 'jekyll', '> 3.5', '< 5.0'
18+
s.add_dependency 'jekyll', '> 3.5', '< 4.0'
1919
s.add_runtime_dependency 'jekyll-github-metadata', '~> 2.9'
2020
s.add_runtime_dependency 'jekyll-seo-tag', '~> 2.0'
2121
s.add_development_dependency 'html-proofer', '~> 3.0'

script/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33

44
set -e
55

6-
npx webpack --env dev
6+
npx webpack
77
JEKYLL_ENV=dev bundle exec jekyll build

script/ci-site-preview-build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/sh
2+
# Build a preview of the theme, only to be used in conjunction with
3+
# Primer Spec Preview.
4+
5+
set -e
6+
7+
if [ "$#" != 1 ]; then
8+
echo "Usage: $0 BASE_URL"
9+
exit 1
10+
fi
11+
BASE_URL="$1"
12+
13+
npx webpack --env.base_url="$BASE_URL"
14+
JEKYLL_ENV=site-preview bundle exec jekyll build

script/cibuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
npx webpack --env prod
5+
npx webpack --env.production
66
JEKYLL_ENV=prod bundle exec jekyll build
77
bundle exec htmlproofer ./_site --check-html --url-ignore "/web.archive.org/,/localhost/"
88
bundle exec rubocop -D

0 commit comments

Comments
 (0)