-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/python3 | ||
# -*- coding: utf-8 -*- | ||
# This is a part of CMSeeK, check the LICENSE file for more information | ||
# Copyright (c) 2022 Konstantin Shibkov | ||
|
||
## Hugo version detection | ||
## Rev 1 | ||
|
||
import cmseekdb.basic as cmseek | ||
import re | ||
|
||
def start(source): | ||
version = '0' | ||
cmseek.statement('Detecting Version') | ||
cmseek.statement('Generator Tag Available... Trying version detection using generator meta tag') | ||
rr = re.findall(r'<meta name=[\"]*generator[\"]* content=\"Hugo (.*?)\"', source) | ||
if rr != []: | ||
version = rr[0] | ||
cmseek.success(cmseek.bold + cmseek.fgreen + "Version Detected, Hugo Version %s" % version + cmseek.cln) | ||
return version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters