Skip to content

Commit c51370a

Browse files
authored
Optimize (#11)
* replace images with webp * fix profile image * cche contol headers * use display swap * use display swap * gzip * moar fast * thumbnails * theme * all thumbanils * theme * theme * fix blog files * smaller images
1 parent 2c38a1f commit c51370a

238 files changed

Lines changed: 250 additions & 169 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/localize-images.bash

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#! /bin/bash
2+
3+
4+
DIR=${1:-"src/content/blog"}
5+
CDIR=${2:-"/tmp/blog.edwardawebb.com/wp-content/uploads/"}
6+
for file in ${DIR}/*.md; do
7+
ign="${file##*/}"
8+
newdir="${DIR}/${ign%.md}"
9+
echo -e "\t>${newdir}"
10+
mkdir "${newdir}"
11+
mv "$file" "${newdir}/index.md"
12+
13+
images=$(grep -oh "\(https://blog.edwardawebb.com/wp-content/uploads/[A-Za-z0-9/_-]*\.png\)" ${newdir}/index.md)
14+
for image in $images;do
15+
tnp="${image##*/}"
16+
target=$"${tnp%.png}.webp"
17+
echo -e "\t>${target}"
18+
#cp ${CDIR}/${image#"https://blog.edwardawebb.com/wp-content/uploads/"} "${newdir}/${target}"
19+
20+
cwebp -q 50 "${CDIR}/${image#"https://blog.edwardawebb.com/wp-content/uploads/"}" -o "${newdir}/${target}";
21+
sed -i '' "s#${image}#${target}#" ${newdir}/index.md
22+
done
23+
24+
done
25+
26+
27+
#grep -oh "\(https://blog.edwardawebb.com/wp-content/uploads/[A-Za-z0-9/_-]*\.png\)" src/content/blog/keys-putty-cygwin-passwordless-login-ssh-scp.md

.circleci/optimize-images.bash

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /bin/bash
2+
3+
#
4+
# webp all the images!
5+
#
6+
DIR=${1:-"src/static/img"}
7+
CDIR=${2:-"src/content"}
8+
for file in ${DIR}/*; do
9+
newname="${file%.*}.webp"
10+
cwebp -q 50 "${file}" -o "${newname}";
11+
cwebp -q 50 "${file}" -resize 300 0 -o "${file%.*}-thumb.webp";
12+
find ${CDIR} -type f -name '*.md' | xargs sed -i '' 's#'${file#"src/static/img"}'#'${newname#"src/static/img"}'#g'
13+
done

src/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pygmentsCodeFencesGuessSyntax = true
1414
[params]
1515
firstName = "Eddie"
1616
lastName = "Webb"
17-
profileImage = "img/TechChat.png"
17+
profileImage = "img/TechChat.webp"
1818
phone = "603-463-0447"
1919
contactNote = "DevTools Engineer and DevOps Culture advocate"
2020
address = "Peru, NY"

src/content/atlassian_eula.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ Any personal information required for licensing and billing is collected and pro
3434
This information can be used for analysis and improvement of the Eddie's products and services. It may also be used to contact you regarding product or service related topics, as you have listed yourself as a contact for the plugin at Atlassian’s Marketplace.
3535

3636
### Google Analytics
37-
Google Analytics is used by Atlassian to collect usage information on the Atlassian Marketplace add-on listing pages. Any private information collected by Atlassian or third party partners on the Atlassian Marketplace website is governed by the Atlassian Privacy Policy. Eddie does receive Google Analytics data from the Atlassian Marketplace website but has no control over their collection, storage and processing.
37+
Google Analytics is used by Atlassian to collect usage information on the Atlassian Marketplace add-on listing pages. Any private information collected by Atlassian or third party partners on the Atlassian Marketplace website is governed by the Atlassian Privacy Policy. Eddie does receive Google Analytics data from the Atlassian Marketplace website but has no control over their collection, storage and processing.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ sitemap:
55
---
66
This section contains articles migrated from my old Wordpress site. Forgive the formatting please :)
77

8-
The "featured" articles are those with highest comment count from WP.
8+
The "featured" articles are those with highest comment count from WP.

src/content/blog/add-rss-feed-cakephp-models.md renamed to src/content/blog/add-rss-feed-cakephp-models/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ Yes, you'll notice an additional route there for [dynamic sitemaps](https://blog
132132
Dr. Neil Hair comments on the Virtual Workforce of the
133133
future.
134134
http://www.democratandchronicle.com/apps/pbcs.dll/article?AID=2008810050343
135-
Mon, 06 Oct 2008 09:03:36 -0400
135+
Mon, 06 Oct 2008 09:03:36 -0400

src/content/blog/assign-custom-object-identities-jpa.md renamed to src/content/blog/assign-custom-object-identities-jpa/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ Next we tell each entity to use the SEQUENCE id generation strategy to generate
3131

3232
### Sample Persistence.xml to declare the custome id generator
3333

34-
The only secret here is to set the system property for our custom class. Again this is only if you have one custom sequencer. To use multiple classes you will need to specify the fully qualified class name (including "()" even if not required) with each entity for the Sequencer name. If you do specify one here it will be available under the name "system" for any entity that declares it.
34+
The only secret here is to set the system property for our custom class. Again this is only if you have one custom sequencer. To use multiple classes you will need to specify the fully qualified class name (including "()" even if not required) with each entity for the Sequencer name. If you do specify one here it will be available under the name "system" for any entity that declares it.

src/content/blog/automatically-choose-database-connections-cakephp.md renamed to src/content/blog/automatically-choose-database-connections-cakephp/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ class DATABASE_CONFIG
7777

7878
### What's Happening
7979

80-
PHP provides a whole bunch of useful server variables, one of which is the name of the server hosting the scripts. When the database class gets created, the construct function (if present) is called. This is true of any PHP class. We take advantage of this to check our server's name before actually setting up the connections. If we are not using the local server, then we set the default connection to use our production connection, otherwise we use our local connection. NOTE: The order is important here, since CakePHP's bake script will not have a server name, so we should always default to localhost, since thats where any backing would occur anyhow.
80+
PHP provides a whole bunch of useful server variables, one of which is the name of the server hosting the scripts. When the database class gets created, the construct function (if present) is called. This is true of any PHP class. We take advantage of this to check our server's name before actually setting up the connections. If we are not using the local server, then we set the default connection to use our production connection, otherwise we use our local connection. NOTE: The order is important here, since CakePHP's bake script will not have a server name, so we should always default to localhost, since thats where any backing would occur anyhow.

src/content/blog/automatically-subscribe-users-dreamhost-announce-lists.md renamed to src/content/blog/automatically-subscribe-users-dreamhost-announce-lists/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Without using POST? I am not sure about that.. but using a checkbox to subscribe
1616

1717
So it goes like this; Your user registers a new account, or sends you a contact message. As part of the form they submit their email address and name.  We in turn pass that email and name onto DreamHost's panel API thereby adding the user to future announcements. The code I will explain needs to go in the form's receiving code. We will check for the checkbox's value, and if necessary handle the additional choir. This code should be pasted into your contact form or registration form wherever the initial data is received and handled.
1818

19-
[![The red boundary denotes new code for the announce submission](https://blog.edwardawebb.com/wp-content/uploads/2009/08/process1.png "process")](https://blog.edwardawebb.com/wp-content/uploads/2009/08/process1.png)
19+
[![The red boundary denotes new code for the announce submission](process1.webp "process")](process1.webp)
2020

2121
The red boundary denotes new code for the announce submission
2222

@@ -74,4 +74,4 @@ Unable to add your email to our announcement list please contact site administra
7474

7575
### Getting a DreamHost API key
7676

77-
[More info on DreamHost API](http://wiki.dreamhost.com/Application_programming_interface#What_values_does_DreamHost.27s_API_use.3F)
77+
[More info on DreamHost API](http://wiki.dreamhost.com/Application_programming_interface#What_values_does_DreamHost.27s_API_use.3F)
8.5 KB
Loading

0 commit comments

Comments
 (0)