이온디
호스팅센터
웹디벨로퍼
프리랜서카페
스레드
현재글(본문 키워드 기반 제목 매칭 해시태그 등록 작업})

제목이나 본문에 반복적으로 포함된 단어를 기반으로 태그를 자동 생성해주는 애드온이 있을까요? 찾아보니 카테고리를 기반으로 자동 생성해 주는 애드온은 있는 것 같아요


[작업의뢰내용]

1. 본문 내용 

2. 연관글출력


작업비용 : 25만원



아마 2-2로 가야할거 같다.

그래야지 연관글도 출력이 될테니깐.

 


내용을 입력하세요
0
  • Profile
    2025 년 02 월 09 일 (15:11)
    <script>
        function generateTags() {
           var title = document.getElementById('postTitle').value;
           var content = document.querySelector('input[name="content"]').value;
           var cleanedContent = content.replace(/<\/?[^>]+(>|$)|&nbsp;/g, " ").replace(/&[^;]+;/g, "").replace(/[^\w\s가-힣-,]/g, "");
           console.log(cleanedContent);
           var titleTags = title.replace(/<\/?[^>]+(>|$)|&[^;]+;/g, "").replace(/[^\w\s가-힣-,]/g, "").split(/[\s,]+/);
           var contentTags = cleanedContent.split(/[\s,]+/);
           var commonTags = titleTags.filter(tag => contentTags.includes(tag));
           var tagsString = commonTags.join(',');
           document.getElementById('tags').value = tagsString;
           var tagsLabel = document.querySelector('label[for="tags"]');
           if (tagsString) {
              tagsLabel.style.display = 'none';
           }
        }
    
        document.addEventListener('DOMContentLoaded', function() {
           var contentInput = document.querySelector('input[name="content"]');
           var observer = new MutationObserver(generateTags);
           observer.observe(contentInput, { attributes: true, attributeFilter: ['value'] });
        });
    </script>
    답변 달기