Skip to content

Commit

Permalink
images: move referenced images to page bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
Pondidum committed Jul 15, 2023
1 parent 59270b7 commit cfaa78a
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 14 deletions.
17 changes: 15 additions & 2 deletions bundle.sh
Expand Up @@ -2,7 +2,7 @@

set -eu

rg --files-with-matches --fixed-strings "(/images/" ./content/post | sort | while read -r file; do
rg --files-with-matches --fixed-strings "/images/" ./content/post | sort | while read -r file; do
echo "==> $file"

dir_name=$(basename "$file" ".md")
Expand All @@ -11,7 +11,7 @@ rg --files-with-matches --fixed-strings "(/images/" ./content/post | sort | whil
echo " dir path: $dir_path"
mkdir -p "$dir_path"

echo " inline references"
echo " inline images"

rg --only-matching "\(/images/.*\)" --no-line-number "$file" | tr -d "()" | uniq | while read -r image_path; do
echo " - $image_path"
Expand All @@ -25,6 +25,19 @@ rg --files-with-matches --fixed-strings "(/images/" ./content/post | sort | whil

done

echo " referenced images"
rg --only-matching "]: /images/.*" --no-line-number "$file" | sed -n 's/]: \(.*\)/\1/p' | uniq | while read -r image_path; do
echo " - $image_path"

image_name=$(basename "$image_path")

echo " - $image_name"

mv "./static$image_path" "$dir_path" || true
sed -i "s,]: $image_path,]: $image_name,g" "$file"

done


echo " move file"
mv "$file" "$dir_path/index.md"
Expand Down
File renamed without changes
Expand Up @@ -20,4 +20,4 @@ The moral of the story? If in doubt, copy Google.
[1]: /functionality-and-seperation-of-concerns
[2]: http://quince.infragistics.com
[3]: http://www.welie.com
[4]: /images/gmail-selection.jpg
[4]: gmail-selection.jpg
Expand Up @@ -64,4 +64,4 @@ AppDomain.CurrentDomain.SetData("APPBASE", currDir);
Hope that helps everyone who has to do this kind of conversion.

[1]: http://social.msdn.microsoft.com/Forums/en/vststest/thread/433e4860-b61f-44fd-bef9-a569fb32d244
[2]: /images/unblock-file.jpg
[2]: unblock-file.jpg
File renamed without changes
File renamed without changes
Expand Up @@ -17,4 +17,4 @@ Now while I have no problem in making the change, I do however wonder what cause

Another thing is that while it is a very minor change, it must have been causing user friction for the last 6 years or so, and no one has mentioned it? Maybe they just didn't think it was changeable, or that it just wasn't that bothersome compared to some other issue they had?

[1]: /images/form-validation.jpg
[1]: form-validation.jpg
Expand Up @@ -37,7 +37,7 @@ The Model is the data to be displayed. This can either be an abstraction that e
[2]: http://codebetter.com/jeremymiller/2007/07/26/the-build-your-own-cab-series-table-of-contents/
[3]: http://martinfowler.com/eaaDev/PassiveScreen.html
[4]: http://martinfowler.com/eaaDev/SupervisingPresenter.html
[5]: /images/mvp-diagram.jpg
[5]: mvp-diagram.jpg
[6]: /model-view-presenters-presenter-to-view-communication
[7]: /model-view-presenters-view-to-presenter-communication
[8]: /model-view-presenters-composite-views
File renamed without changes
Expand Up @@ -171,4 +171,4 @@ Out of the three methods outlined, Method 2 is my personal preference, especiall
[1]: /model-view-presenter-introduction
[2]: /model-view-presenters-presenter-to-view-communication
[3]: /model-view-presenters-view-to-presenter-communication
[4]: /images/mvp-sub-view-diagram.jpg
[4]: mvp-sub-view-diagram.jpg
File renamed without changes
Expand Up @@ -60,6 +60,6 @@ As you can see, the two control's ToolStrips contents is unique, and we have the


[1]: http://msdn.microsoft.com/en-us/library/system.windows.forms.usercontrol.aspx
[2]: /images/sub-designer-control.png
[2]: sub-designer-control.png
[3]: http://msdn.microsoft.com/en-us/library/system.windows.forms.design.controldesigner.aspx
[4]: /images/sub-designer-designtime.png
[4]: sub-designer-designtime.png
File renamed without changes
File renamed without changes
Expand Up @@ -28,7 +28,7 @@ If this was a web application, you could even make it work out which UI to displ
Mockups were made using [Moqups.com][mocking-tool]
Names generated with [Behind THe Name][name-gen]

[ui-sales]: /images/specialised-sales.png
[ui-legal]: /images/specialised-legal.png
[ui-sales]: specialised-sales.png
[ui-legal]: specialised-legal.png
[name-gen]: http://www.behindthename.com/random/
[mocking-tool]: https://moqups.com/
File renamed without changes
File renamed without changes
Expand Up @@ -97,7 +97,7 @@ My only solution to this is: **Don't tick that box**. I don't think I have ever

Using this method means less code and projects to maintain, and a very easy path to go from running a service as a desktop application to service.

[vs-new-project]: /images/service-new.png
[vs-project-type]: /images/service-project-type.png
[service-logon]: /images/service-interact.png
[vs-new-project]: service-new.png
[vs-project-type]: service-project-type.png
[service-logon]: service-interact.png
[serilog]: http://serilog.net/
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.

0 comments on commit cfaa78a

Please sign in to comment.