mirror of
https://gitlab.com/siarp/siarp.de.git
synced 2026-08-07 19:18:17 +00:00
86 lines
2.6 KiB
Markdown
86 lines
2.6 KiB
Markdown
# siarp.de
|
|
|
|
Static copy of the Drupal 7 site.
|
|
|
|
## Steps taken to copy
|
|
|
|
### 1. Simplify site
|
|
|
|
- Remove commenting permission for logged-in users
|
|
- Remove tag cloud block
|
|
- Remove tags list on articles
|
|
- Disable pagination for home page (see below)
|
|
- Disable pagination for blog by author views
|
|
- Disable unnecessary modules
|
|
|
|
#### How to disable pagination on home page?
|
|
|
|
In site settings you can set items on home page to max of 30. If you need more:
|
|
|
|
```
|
|
diff --git a/modules/node/node.module b/modules/node/node.module
|
|
index 1c0e518..9196efd 100644
|
|
--- a/modules/node/node.module
|
|
+++ b/modules/node/node.module
|
|
@@ -2698,7 +2698,7 @@ function node_page_default() {
|
|
->orderBy('n.sticky', 'DESC')
|
|
->orderBy('n.created', 'DESC')
|
|
->extend('PagerDefault')
|
|
- ->limit(variable_get('default_nodes_main', 10))
|
|
+ ->limit(1000)//variable_get('default_nodes_main', 10))
|
|
->addTag('node_access');
|
|
|
|
$nids = $select->execute()->fetchCol();
|
|
```
|
|
|
|
### 2. Mirror site with structure rewrite for index.html files
|
|
|
|
```
|
|
httrack http://siarp.de -O . -N "%h%p/%n/index%[page].%t" -WqQ%v --robots=0
|
|
```
|
|
|
|
See https://www.lullabot.com/articles/sending-a-drupal-site-into-retirement
|
|
|
|
### 3. Replace index.html links with /
|
|
|
|
```
|
|
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\/index.html/\//g"
|
|
```
|
|
|
|
See also https://www.lullabot.com/articles/sending-a-drupal-site-into-retirement
|
|
|
|
And
|
|
```
|
|
mv index/index.html .
|
|
rm -r index/
|
|
perl -i -pe "s/\.\.\///g" index.html
|
|
perl -i -pe "s/\"index\.html\"/\".\/\"/g" index.html
|
|
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\.\.\/\.\.\/index\//..\/..\//g"
|
|
```
|
|
|
|
### 4. Replace /index.* in assets and files
|
|
|
|
Because we used this index structure in step 1, all non-HTML paths are also rewritten to the /index.* pattern.
|
|
|
|
First, we download the files and assets without rewriting by using HTTrack again in another, temporary directory:
|
|
```
|
|
httrack http://siarp.de -K -O . -N --robots=0
|
|
```
|
|
From there we move (overwrite) over the files to our working directory.
|
|
```
|
|
rm -rf martin misc modules PFAD rss sites themes tilman
|
|
cd ../../httrack-abs/siarp.de
|
|
mv martin.xml misc modules rss.xml sites themes tilman.xml ../../httrack-clean/siarp.de
|
|
cd ../../working-dir/siarp.de
|
|
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe "s/\/index\././g"
|
|
```
|
|
|
|
### More cleanup
|
|
|
|
```
|
|
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe 's/<link rel="(canonical|shortlink)" href=".+?" \/>\n//g'
|
|
```
|
|
```
|
|
find . -name "*.html" -type f -print0 | xargs -0 perl -i -pe 's/<\!\-\- Added by HTTrack \-\-><meta http\-equiv="content-type" content="text\/html;charset=utf\-8" \/><\!\-\- \/Added by HTTrack \-\->\n//g'
|
|
```
|