Skip to content

Commit

Permalink
feat(plugins/memosplus/): 设置:GitHub.MemoFileName
Browse files Browse the repository at this point in the history
  • Loading branch information
yiyungent committed Mar 14, 2023
1 parent 05ee959 commit 21d030a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion plugins/MemosPlus/MemosPlus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ public async Task ExecuteAsync()
try
{
// 纯文本
string repoTargetFilePath = $"{settings.GitHub.RepoTargetDirPath}/{item.creatorName}/{item.createdTs.ToDateTime10().ToString("yyyy-MM-dd HH-mm-ss")}.md";
string memoFileName = settings.GitHub.MemoFileName.Replace("{{date}}", item.createdTs.ToDateTime10().ToString("yyyy-MM-dd-HH-mm-ss"));
string repoTargetFilePath = $"{settings.GitHub.RepoTargetDirPath}/{item.creatorName}/{memoFileName}";
// 注意: 先放进来, 防止后面报错导致没有放进去, 从而最终导致没有记录而误删
memoFilePaths.Add(repoTargetFilePath);
string createTimeStr = item.createdTs.ToDateTime10().ToString("yyyy-MM-dd HH:mm:ss");
Expand Down
4 changes: 2 additions & 2 deletions plugins/MemosPlus/MemosPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>PluginCore.MemosPlus</PackageId>
<Version>0.1.4</Version>
<FileVersion>0.1.4.0</FileVersion>
<Version>0.1.5</Version>
<FileVersion>0.1.5.0</FileVersion>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Company>yiyun</Company>
<Authors>yiyun</Authors>
Expand Down
6 changes: 2 additions & 4 deletions plugins/MemosPlus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@


<!-- Matomo Image Tracker-->
<img referrerpolicy="no-referrer-when-downgrade" src="https://matomo.moeci.com/matomo.php?idsite=2&amp;rec=1&amp;action_name=Plugins.MemosPlus-v0.1.4.README" style="border:0" alt="" />
<!-- End Matomo -->


<img referrerpolicy="no-referrer-when-downgrade" src="https://matomo.moeci.com/matomo.php?idsite=2&amp;rec=1&amp;action_name=Plugins.MemosPlus-v0.1.5.README" style="border:0" alt="" />
<!--
### 其它
> `设置` 中 `SecondsPeriod` 为 `定时周期`: 单位为 `秒`
Expand Down
7 changes: 7 additions & 0 deletions plugins/MemosPlus/SettingsModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ public class GitHubModel
public string RepoBranch { get; set; }

public string RepoTargetDirPath { get; set; }

/// <summary>
/// 默认: memo-{{date}}.md
/// eg: memo-2022-10-12-22-12-23.md
/// </summary>
/// <value></value>
public string MemoFileName { get; set; }
}

public BackupModel Backup { get; set; }
Expand Down
2 changes: 1 addition & 1 deletion plugins/MemosPlus/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"DisplayName": "memos+",
"Description": "提升 memos 体验",
"Author": "yiyun",
"Version": "0.1.4",
"Version": "0.1.5",
"SupportedVersions": [ "0.0.1" ]
}
3 changes: 2 additions & 1 deletion plugins/MemosPlus/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"RepoOwner": "your GitHub UserName",
"RepoName": "your Repository Name",
"RepoBranch": "your branch: master/main",
"RepoTargetDirPath": "示例: source/_posts/分类-memos/"
"RepoTargetDirPath": "示例: source/_posts/分类-memos/",
"MemoFileName": "memo-{{date}}.md"
},
"Backup": {
"EnableBackupToGitHub": false
Expand Down

0 comments on commit 21d030a

Please sign in to comment.