-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathREADME
More file actions
75 lines (58 loc) · 1.97 KB
/
Copy pathREADME
File metadata and controls
75 lines (58 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SEO_Link app
=============
If you have a big site and want insert links into your content,
but do not want to edit all the content, this is the app for you.
It makes SEO link shaping a charm.
Description
#############
This reusable app is designed for injecting SEO Links to content areas
of a website.
It parses the html output and injects links based on a term dictionary.
The injection of the terms and links can be configured.
The injection is triggered based on OperationPath rules.
e.g. path contains/startswith/regex/exact : /abc/
The content area the injection should be done with can be
configured:
- OPERATIONAL_CSS_SELECTOR_CLASSES
- OPERATIONAL_CSS_SELECTOR_IDS
- IGNORE_CSS_SELECTOR_CLASSES
- IGNORE_CSS_SELECTOR_IDS
This way you could mark content areas, where the operation should be performed.
Installation
-------------
Add it to your installed apps:
INSTALLED_APPS += ['seo_link']
Set the middleware as last in your middleware classes chain,
but before any csrf middleware if you want to use any form
of caching
MIDDLEWARE_CLASSES = [
...
'django.middleware.common.CommonMiddleware',
...
'seo_link.middleware.SeoLinkMiddleware',
]
To enable the admin preview functionality and the test cases
add url(r"^link/", include("seo_link.tests.urls")),
to your urls conf.
First steps:
There is a basic configuration included in the test cases.
python manage.py test seo_link --failfast
Dependencies:
--------------
BeautifulSoup
South
Django
- optional lxml
Backends:
----------
- seo_link.backends.simple.SimpleBackend
It is Beautiful Soup Based
- seo_link.backends.simple.SimpleCachedBackend
Cached version of the Simple Backend
- seo_link.backends.advanced.LXMLBackend
LXML Based version
- seo_link.backends.advanced.LXMLCachedBackend
Cached LXML version
Settings:
----------
please check the seo_link/settings.py for all the possible configurations